package com.alibaba.nacos.config.server.jpa.config;

import com.alibaba.nacos.config.server.service.DataSourceService;
import com.alibaba.nacos.config.server.service.DynamicDataSource;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

/**
 * The type of nacos-all.
 *
 * @author 问道于盲
 * @date 2020-03-12
 */
@Component
@Primary
public class JpaDynamicDataSource extends DynamicDataSource {

    @Override
    public DataSourceService getDataSource() {
        return getApplicationContext().getBean(JpaDataSourceService.class);
    }
}
